package com.flex.core.model.base
{
	import com.flex.core.constants.GameConstants;
	
	import flash.display.DisplayObject;
	
	import mx.core.UIComponent;

	/**
	 * @author sam
	 */ 
	public class GameUIComponent extends UIComponent
	{
		public function GameUIComponent()
		{
			super();
		}

		/**
		 * override addChild,just want to put child to GameConstants.BASE_ELE_MAP to comply function like getElementById in javascript
		 */
		override public function addChild(child:DisplayObject):DisplayObject
		{
			GameConstants.BASE_ELE_MAP.puts(child["id"], child);
			return super.addChild(child);
		}
		
		/**
		 * override removeChild,just want to remove child from GameConstants.BASE_ELE_MAP 
		 */
		override public function removeChild(child:DisplayObject):DisplayObject
		{
			GameConstants.BASE_ELE_MAP.remove(child["id"]);
			return super.removeChild(child);
		}



	}

}